import React from "react";
import type { RichTextEditorProps } from "~/components/Editor/RichTextEditor.js";
import { RichTextEditor } from "~/components/Editor/RichTextEditor.js";
import { Toolbar } from "~/components/Toolbar/Toolbar.js";

interface ParagraphLexicalEditorProps extends RichTextEditorProps {
    tag?: "p";
}

const styles = { padding: 5 };

const ParagraphEditor = ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => {
    return (
        <RichTextEditor
            toolbar={<Toolbar />}
            tag={tag ?? "p"}
            placeholder={placeholder ?? "Enter your text here..."}
            {...rest}
            styles={styles}
        >
            {rest?.children}
        </RichTextEditor>
    );
};

export { ParagraphEditor };
